package org.jb.coinche.client.gin;

import java.util.HashSet;
import java.util.Set;

import org.jb.coinche.client.gui.chat.ChatWidget;
import org.jb.coinche.client.guistatemachine.GUIStateMachine;
import org.jb.coinche.client.notify.NotificationListener;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;

public class NotificationListenerModule extends AbstractGinModule {

	@SuppressWarnings("unchecked")
	@Override
	protected void configure() {
		bind( new TypeLiteral< Set<NotificationListener> >() {}).toProvider(NotificationListenerProvider.class);
		
	}

	/*
	 * 
	 */
	@SuppressWarnings("unchecked")
	public static class NotificationListenerProvider implements Provider< Set<NotificationListener > > {

		@Inject
		private ChatWidget h1;
		
		@Inject
		private GUIStateMachine h2;
		
		@Override
		public Set<NotificationListener> get() {
			Set<NotificationListener > set = new HashSet< NotificationListener >();
			set.add(h1);
			set.add(h2);

			return set;
		}
	}
	
}
